const mongoose = require("mongoose");
const { Schema, model } = mongoose;
const PageSchema = new Schema({
  name: {
    type: String,
    required: true,
  },
  project: {
    type: Schema.Types.ObjectId,
    ref: "_Project",
    required: true,
  },
  url: {
    type: String,
  },
  components: {
    type: Array,
    default: [],
  },
  modals: {
    type: Array,
    default: [],
  },
  grids: {
    type: Object,
    default: {},
  },
  createAt: {
    type: Date,
    default: Date.now,
  },
  updateAt: {
    type: Date,
    default: Date.now,
  },
});

module.exports = model("_Page", PageSchema, "page");
